<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="UTF-8">
<title>Triple Buy Angel</title>
<link href="${pageContext.request.contextPath }/css/mystyle.css"
	rel="stylesheet">
</head>
<body>
	<div id="div1"></div>
	<div id="#container">
		<div id="header">
			<b id="fonts1">买买买小天使 Triple Buy Angel</b>
			<div id="login">
				<b id="fonts2"> <c:choose>
						<c:when test="${email != ''}">
							<b id="fonts2">Hello "${email }" <a
								href="${pageContext.request.contextPath }/ShowOrderListServlet"> <input type="button"
									value="OrderList" class="btn"></input> </a>
									 <a href="${pageContext.request.contextPath }/LoginServlet">
										<input type="button" value="Back" class="btn"></input>
								</a>
									<a href="${pageContext.request.contextPath }/IndexServlet">
										<input type="button" value="Logout" class="btn"></input>
								</a></b>
						</c:when>
						<c:otherwise>
							<form action="${pageContext.request.contextPath }/LoginServlet" method="post">
								E-mail<input type="text" name="email"></input> Password<input
									type="password" name="password"></input> <font color="red">${error }</font>
								<input type="submit" value="Login" class="btn" id="loginBtn"></input>
							</form>
							<a href="${pageContext.request.contextPath }/jsp/register.jsp">
								<input type="button" value="Register" class="btn"></input>
							</a>
						</c:otherwise>
					</c:choose>
				</b>
			</div>
		</div>
		<div id="ordertnav">
			<b class="fonts4">Check Out</b>
			<table id="orderList" >
				<c:forEach var="dnameNum" items="${dnameNum}">
					<tr class = "fonts3">
						<td>${dnameNum.key}</td>
						<td>${dnameNum.value}</td>
					</tr>
				</c:forEach>
				<tr>
					<td><p class = "fonts3">Total Price : ${total} RMB</p></td>
				</tr>
				
			</table>
			<c:if test="${total != 0}">
				<form action="${pageContext.request.contextPath }/PayServlet" method="post">
				<input type="hidden" value="${email}" name="email"></input>
				<input type="hidden" value="${total}" name="total"></input>
				<input type="submit" value="Pay" class="btn"></input>
			</form>
			</c:if>
			
		</div>
	</div>



</body>
<script src="${pageContext.request.contextPath }/js/addToCart.js"></script>
<script src="${pageContext.request.contextPath }/js/Map.js"></script>
</html>